<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8" />
	<link href="https://cdn.bootcss.com/mapbox-gl/0.45.0-beta.1/mapbox-gl.css" rel="stylesheet">
	<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" />
	<title></title>
	<link rel="stylesheet" href="css/map.css">
	<style type="text/css">
		@font-face {
			font-family: 'fzxs12regular';
			src: url('font/12-webfont.woff2') format('woff2'),
			url('font/12-webfont.woff') format('woff');
			font-weight: normal;
			font-style: normal;

		}

		body,
		html {
			margin: 0;
			padding: 0;
		}

		#map1 {
			height: 460px;
			height: 90vh;
			float: left;
			margin-right: 15px;
			width: 24%;
			background-image: url(img/le.png);
			background-repeat: no-repeat;
			background-size: 79% 90vh;
			position: relative;
		}

		#map2 {
			height: 460px;
			height: 90vh;
			float: right;
			width: 24.5%;
			display: flex;
			flex-wrap: wrap;
			align-content: flex-start;
			/*background: #000822;*/
			/*background-image: url(img/right.png);
			background-position: right 4vh;
		    background-repeat: no-repeat;
			background-size: 45% 40vh;*/
			position: relative;
		}

		#map {
			float: left;
			position: relative;
			z-index: -10000;
		}

		#title {
			width: 100%;
			height: 10vh;
			text-align: center;
			font-size: 24px;
		}

		#map1-a,
		#map1-b,
		#map2-a,
		#map2-b {
			width: 100%;
			height: 225px;
			height: 30vh;
		}

		#map3 {
			width: 49%;
			height: 230px;
			height: 30vh;
			float: left;
			background-image: url(img/bo.png);
			background-repeat: no-repeat;
			background-size: 100% 100%;
			position: relative;
		}

		#map3-a,
		#map3-c {
			height: 230px;
			height: 30vh;
			width: 100%;
		}

		#map3-b {
			float: left;
			font-size: 2vh;
			color: #1dcffa;
			width: 84%;
			position: absolute;
			left: 11vh;
			top: 6vh;
			height: 19.5vh;
		}

		body {
			background-color: #0d2127;
		}

		#map1-a {}

		#map1-b {}

		.chartName {
			position: absolute;
			top: -0.5vh;
			left: 22%;
			color: #00f7fe;
			font-size: 2vh;
			font-family: 'fzxs12regular' sans-serif;
		}

		.chartName span {
			letter-spacing: 1.5px;
			font-size: 1vh;
		}

		.chartName2 {
			position: absolute;
			top: -0.5vh;
			right: 14%;
			color: #277bce;
			font-size: 2vh;
		}

		.chartName3 {
			position: absolute;
			top: 0.5vh;
			left: 19%;
			color: #F05B60;
			font-size: 2vh;
		}

		.chartName4 {
			position: absolute;
			top: 4.6vh;
			color: #1dcffa;
			font-size: 2.5vh;
			right: 40%;
			border: 1px solid;
			border-top: none;
			padding: 0 1.2vh 0.6vh;
		}


		.tperson {
			position: absolute;
			top: 2vh;
			color: #fff;
			font-size: 3vh;
			font-family: monospace;

		}

		.tperson span,
		.tmoney span {
			font-family: 'fzxs12regular';
			font-size: 4vh;
		}

		.tperson span {
			font-size: 3.5vh;
		}

		.tmoney {
			color: #fff;
			font-size: 3.5vh;
			/*position: relative;*/
			font-family: monospace;


			z-index: 999;
			transform: skewX(-20deg);
		}

		@media screen and (min-width:1300px) {
			#title img {
				width: 50% !important;
			}
		}

		#one {
			position: absolute;
			left: 0;
			top: -10vh;
			width: 100%;
			height: 100vh;
			z-index: -999;
		}

		.map2-row,
		.map1-row {
			width: 100%;
			/* height: 2vh; */
		}

		.map1-row {
			position: absolute;
			display: flex;
			top: -7vh;
			/* justify-content:space-around; */
			padding-left: 20%;
		}

		#ba {
			position: absolute;
			left: 0;
			top: 0vh;
			width: 100%;
			height: 45vh;
			z-index: -1099;
			background: -webkit-linear-gradient(#0e1b2d 10%, #5386be 50%);
			/* Safari 5.1 - 6.0 */
			background: -o-linear-gradient(#0e1b2d 10%, #5386be 50%);
			/* Opera 11.1 - 12.0 */
			background: -moz-linear-gradient(#0e1b2d 10%, #5386be 50%);
			/* Firefox 3.6 - 15 */
			background: linear-gradient(#0e1b2d 10%, #5386be 50%)/* 标准的语法（必须放在最后） */
		}

		.map2-colum {
			width: 31%;
			margin-right: 2%;
			height: 12vh;
			display: inline-block;
		}

		p {
			margin: 0;
			border: 0;
		}

		.map2-text {
			background-color: rgba(53, 192, 255, 0.65);
			font-size: 1.55vh;
			color: #fff;
			padding: 0.7vh 0px 0.7vh 0.7vh;
			font-family: '微软雅黑';
			text-overflow: ellipsis;
			white-space: nowrap;
			overflow: hidden;
			/* font-weight:bold; */
		}

		.map2-text:hover {
			cursor: pointer;
		}

		.map2-num {
			color: #E9B94B;
			font-size: 4.8vh;
			text-align: right;
			padding: 0.7vh;
			font-family: 'Agency FB';
		}
	</style>
</head>

<body>
	<div class="centermap"></div>
	<div id="one">
	</div>
	<div id="ba">

	</div>
	<div id="title">
		<img src="img/title2.png" style="width: 45%;" />
		<div>
			<select id="select_county" class="allcounty select2"></select>
			<select id="select_proselect" class="proselect select2"></select>
		</div>
	</div>
	<div id="map1">
		<div class="map1-row">
			<!-- <select id="select_county" class="allcounty select2"></select> -->
			<!-- <select id="select_proselect" class="proselect select2"></select> -->
		</div>
		<div style="position: relative;">
			<div class="chartName" style="top: -2.5vh;">
				地区概况
				<span>（折线：金额；柱状：人数）</span>
				<button class="map_1_SET">设置</button>
				<div class="setInterface">
					<p>
						<span>柱状图数量:</span>
						<input class="nowNum">
					</p>
					<p>
						<span>左一字体:</span>
						<input class="nowSize_1">
						<span>(PX)</span>
					</p>
					<p>
						<span>左二字体:</span>
						<input class="nowSize_2">
						<span>(PX)</span>
					</p>
					<p>
						<span>左三字体:</span>
						<input class="nowSize_3">
						<span>(PX)</span>
					</p>
					<p>
						<span>当前TOP:</span>
						<input class="nowTop">
					</p>
					<p>
						<span>原点大小:</span>
						<input class="hoverSize">
					</p>
					<p>
						<span>折线点大小:</span>
						<input class="symSize">
					</p>
					<p>
						<span>Y轴字体:</span>
						<input class="yAxisSize">
						<span>(1,2)</span>
					</p>
					<p>
						<span>Y轴字体:</span>
						<input class="yAxisSizeLast">
						<span>(3)</span>
					</p>
					<p>
						<span>当前色系:</span>
						<input class="mapColor">
						<span>(7个)</span>
					</p>
					<button class="">完成</button>
				</div>
			</div>
			<div id="map1-a">
			</div>
		</div>
		<div style="position: relative;">
			<div class="chartName" style="color: #e6d69e;">
				地区增幅
				<span>（蓝色：金额；红色：人数）</span>
			</div>
			<div id="map1-b">
			</div>
		</div>
		<div style="position: relative;">
			<div class="chartName3" style="">项目人均发放排名</div>
			<div id="map3-a">
			</div>
		</div>
		<marquee behavior="" direction=""></marquee>
	</div>
	<div id='map' style='width: 49%; height:55vh;padding-top: 5vh;'></div>
	<div id="map2">
		<div class="map2-row">
			<div class="loading"></div>
			<p class="allmoney"></p>
		</div>
	</div>
	<div id="map3">
		<div class="chartName4" style="">监督曝光台</div>
		<div class="data_fz">
			<p class="data_fz_header">
				<span>地区</span>
				<span>发现问题线索</span>
				<span>党纪政务处分</span>
				<span>其他组织处理</span>
			</p>
		</div>
	</div>
	<script src="js/common.js" type="text/javascript" charset="utf-8"></script>
	<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
	<script src="js/jquery-1.9.1.min.js"></script>
	<script src="js/echarts.js"></script>
	<script src="http://echarts.baidu.com/resource/echarts-gl-latest/dist/echarts-gl.min.js"></script>
	<script src="https://cdn.bootcss.com/mapbox-gl/0.45.0-beta.1/mapbox-gl.js"></script>
	<script src="js/json.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/leftTop.js"></script>
	<script src="js/leftCenter.js"></script>
	<script type="text/javascript" src="js/leftbottom.js"></script>
	<script src="js/rightTop.js"></script>
	<script src="js/setOption.js"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script>
	<script>
		var chart;
		mapboxgl.accessToken = 'pk.eyJ1IjoiY291bGlzIiwiYSI6ImNqZ3Z3OXJ5ODE0cDQyeG52bzJ0MjJvdjMifQ.ZkKWpkDmibMo-dUDjAqYXQ';
		function thousandBitSeparator(num) {
			return num && num
				.toString()
				.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
					return $1 + ",";
				});
		}
		$(function () {
			// console.log(thousandBitSeparator('96752932.00'))
			myChart1.showLoading({
				text: "",
				maskColor: "rgba(53, 192, 255, 0)",
			});
			myChart2.showLoading({
				text: "",
				maskColor: "rgba(53, 192, 255, 0)",
			});
			myChart3.showLoading({
				text: "",
				maskColor: "rgba(53, 192, 255, 0)",
			});
			// $('.tperson span').text(thousandBitSeparator('96752932.00').replace('.00',''))
		})
		//	$.getJSON('css/fujian.json',function(mapres){
		startMapdata();
		var mapAllmoney = [], mapAllpeople = [];
		function startMapdata() {
			$.getJSON('css/fujian11.json', function (data) {
				$.post(baseurl + "city/listall", function (result) {
					// console.log(result)
					var geoCoordMap = {}
					var dataPoint = []
					for (var i = 0; i < result.length; i++) {
						mapAllmoney.push(result[i].money);
						geoCoordMap[result[i].name] = [result[i].precision, result[i].latitude]
						dataPoint.push({ 'name': result[i].name, 'value': result[i].money })
					}
					// console.log(mapAllmoney);
					var maxN = Math.max.apply(null, mapAllmoney);
					var minN = Math.min.apply(null, mapAllmoney);
					// console.log(maxN);
					// console.log(minN);
					//				 console.log(geoCoordMap);
					$.post(baseurl + 'city/totalmoney', function (res) {
						// console.log(res)
						var totalmoney = thousandBitSeparator(res).split('.');
						$('.tmoney span').text(totalmoney[0])
						// console.log(totalmoney)
						var convertData = function (data) {
							var res = [];
							for (var i = 0; i < data.length; i++) {
								var geoCoord = geoCoordMap[data[i].name];
								// console.log(data[0].value)
								if (geoCoord) {
									res.push({
										name: data[i].name,
										value: geoCoord.concat(data[i].value)
									});
								}
							}
							//  console.log(res)
							return res;
						};
						echarts.registerMap('fujian', data);
						//				echarts.registerMap('fujianall', mapres);
						//获取地图点击事件
						chart = echarts.init(document.getElementById('one'));
						chart.on('click', function (params) {
							var data_titlename = params.name;
							// console.log(data_titlename);
							// 
							$("#select_county").val(""+data_titlename+"");  
							$('.select2-selection__rendered').eq(0).text(""+data_titlename+"");
							// $("#select_county").find("option[text='"+data_titlename+"']").attr("selected",true);
							// .select2(''+data_titlename+'');  
							clearInterval(settime);
							if (params.data.other) {
								$('.loading').show();
								// city=$(this).text();
								myChart1.showLoading({
									text: "",
									maskColor: "rgba(53, 192, 255, 0)",
								});
								myChart2.showLoading({
									text: "",
									maskColor: "rgba(53, 192, 255, 0)",
								});
								myChart3.showLoading({
									text: "",
									maskColor: "rgba(53, 192, 255, 0)",
								});
								data_Click = JSON.stringify({ "county": data_titlename });
								data_leftBottom = JSON.stringify({ "county": data_titlename, 'top': '7' });
								LeftBottomZone(data_leftBottom)//左三
								$('.dataPosition').stop().animate({ left: "100%" }, "fast");
								// $('.map2-row').children('select').empty();
								dataClick(data_Click);//右边
								leftCenterParam = JSON.stringify({ 'county': data_titlename, 'year': new Date().getFullYear() });
								dataYear(leftCenterParam);//左二
								data_leftTop = JSON.stringify({ 'county': data_titlename });
								dataZone(data_leftTop);//左一
							}

						});
						chart.setOption({
							title: {
								show: false,
								left: 'center',
								text: '{t1|全市发放资金总额:}' + '{title|' + totalmoney + '}',
								textStyle: {
									rich: {
										title: {
											color: '#fff',
											fontSize: 25,
											fontFamily: 'fzxs12regular',
										},
										t1: {
											color: '#fff',
											fontSize: 18,
										}
									}
								}
							},
							geo3D: {
								show: true,
								map: 'fujian',
								regionHeight: 0,
								boxHeight: 7,
								//						environment: '#fff',
								groundPlane: {
									show: true,
									color: '#10272e',
								},
								itemStyle: {
									//							areaColor: '#28555a',
									areaColor: '#10272e',
									opacity: 0.8,
									borderWidth: 1,
									borderColor: '#366c71',
									// borderColor:'#d7ac6b'
								},
								top: 0,
								viewControl: {
									// autoRotate:true,
									distance: 18,
									maxDistance: 40,
									minDistance: 0,
									alpha: 0,
									beta: -20,
									maxBeta: 100,
									center: [12.5, 2, 8],
								}
							},
							tooltip: {
								show: true,
								position: 'left',
								formatter: (params) => {
									// console.log(typeof params.value == 'string')
									var monSum = 0;
									if (!params.value) {
										let data = "<div class='leftCenter_hover'>地区:" + params.name + "</div>";
										return data;
									}
									if (typeof params.value == 'object') {
										monSum = parseInt(params.value[2] / 10000);
										let data = "<div class='leftCenter_hover'>" +
											"<p>地区:" + params.name + "</p>" +
											"<p>发放总额:" + monSum + "万元" + "</p>" +
											"</div>";
										return data;
									} else {
										monSum = params.value;
										let data = "<div class='leftCenter_hover'>" +
											"<p>地区:" + params.name + "</p>" +
											"<p>发放总人数:" + monSum + "人" + "</p>" +
											"</div>";
							    /*+"地理坐标:[" + params.value[0]+","+params.value[1] +"]"*/;
										return data;
									};

								}
							},
							visualMap: [{
								type: 'continuous',
								show: false,
								max: maxN,
								min: 0,
								calculable: true,
								realtime: false,
								inRange: {
									color:['#fb497b','#fec760','#70e522','#4ecbff','#4d7bf4','#214e9f','#6f21d9'],
									// color: [ '#32899d','#938b2a', '#915e35', '#81303c','#37e5c9','#4e895e'],
									//  color:['#FFD700','#DAA520','#F4A460','#CD2626','#FF7F50','#FF4500'],
									// color: colorArrey[colorNow],
									borderColor: '#366c71'
								},
								outOfRange: {
									colorAlpha: 0
								}
							}, {
								show: true,
								type: 'continuous',
								seriesIndex: 1,
								text: ['人数'],
								left: 'center',
								realtime: true,
								textStyle: {
									color: '#fff',
									fontSize: '20',
								},
								//					  backgroundColor:'#FFF',
								max: 150000,
								left: "72%",
								top: "65%",
								//  min:0,
								calculable: false,
								inRange: {
									color:['#fb497b','#fec760','#70e522','#4ecbff','#4d7bf4','#214e9f','#6f21d9'],
									// color: colorArrey[colorNow],
									// color:['#FFD700','#DAA520','#F4A460','#CD2626','#FF7F50','#FF4500'],
									//  color: ['#32899d','#915e35', '#81303c','#37e5c9', '#4e895e', '#938b2a']

								},
								range: [1, 150000],
								outOfRange: {
									colorAlpha: 0
								}
							}],
							series: [
								{
									data: convertData(dataPoint),
									name: 'bar3D',
									type: "bar3D",
									coordinateSystem: 'geo3D',
									barSize: 0.15, //柱子粗细
									shading: 'realistic',
									opacity: 1,
									bevelSize: 0.5,
									label: {
										show: false,
										formatter: '{b}'
									}
								}
								, {
									name: 'map3D',
									type: "map3D",
									map: 'fujian',
									itemStyle: {
										emphasis: { label: { show: false } }
									},
									regionHeight: 0.1,
									boxHeight: 10,
									top: 0,
									viewControl: {
										// autoRotate:true,
										distance: 18,
										maxDistance: 40,
										minDistance: 0,
										alpha: 0,
										beta: -20,
										maxBeta: 100,
										center: [12.5, 2, 8],
									},

									data: [
										{ name: '长乐区', value: 0, other: true },
										{ name: '福清市', value: 0, other: true },
										{ name: '仓山区', value: 0, other: true },
										{ name: '连江县', value: 0, other: true },
										{ name: '闽侯县', value: 0, other: true },
										{ name: '闽清县', value: 0, other: true },
										{ name: '永泰县', value: 0, other: true },
										{ name: '晋安区', value: 0, other: true },
										{ name: '罗源县', value: 0, other: true },
										{ name: '马尾区', value: 0, other: true },
										{ name: '平潭县', value: 0 },
										{ name: '鼓楼区', value: 0, other: true },
										{ name: '台江区', value: 0, other: true },
										{ name: '厦门市', value: 0 },
										{ name: '南平市', value: 0 },
										{ name: '三明市', value: 0 },
										// {name: '龙岩市', value: 0},
										// {name: '宁德市', value: 0},
										// {name: '漳州市', value: 0},
										// {name: '莆田市', value: 0},
										// {name: '泉州市', value: 0},
										{ name: '赣州市', value: 0 },
										{ name: '吉安市', value: 0 },
										{ name: '上饶市', value: 0 },
										{ name: '九江市', value: 0 },
										{ name: '抚州市', value: 0 },
										{ name: '宜春市', value: 0 },
										{ name: '南昌市', value: 0 },
										{ name: '景德镇市', value: 0 },
										{ name: '萍乡市', value: 0 },
										{ name: '鹰潭市', value: 0 },
										{ name: '新余市', value: 0 },
										{ name: '丽水市', value: 0 },
										{ name: '杭州市', value: 0 },
										{ name: '温州市', value: 0 },
										{ name: '宁波市', value: 0 },
										{ name: '舟山市', value: 0 },
										{ name: '台州市', value: 0 },
										{ name: '金华市', value: 0 },
										{ name: '衢州市', value: 0 },
										{ name: '绍兴市', value: 0 },
										{ name: '嘉兴市', value: 0 },
										{ name: '湖州市', value: 0 },
										{ name: '高雄市', value: 0 },
										{ name: '屏东县', value: 0 },
										{ name: '台南市', value: 0 },
										{ name: '新竹市', value: 0 },
										{ name: '新竹县', value: 0 },
										{ name: '宜兰县', value: 0 },
										{ name: '基隆市', value: 0 },
										{ name: '苗栗县', value: 0 },
										{ name: '台北市', value: 0 },
										{ name: '新北市', value: 0 },
										{ name: '桃园县', value: 0 },
										{ name: '彰化县', value: 0 },
										{ name: '嘉义县', value: 0 },
										{ name: '嘉义市', value: 0 },
										{ name: '花莲县', value: 0 },
										{ name: '南投县', value: 0 },
										{ name: '台中市', value: 0 },
										{ name: '云林县', value: 0 },
										{ name: '台东县', value: 0 },
										{ name: '澎湖县', value: 0 },
										{ name: '金门', value: 0 },
										{ name: '马祖', value: 0 },
										{ name: '赣州市', value: 0 },
										{ name: '上饶市', value: 0 },
										{ name: '九江市', value: 0 },
										{ name: '抚州市', value: 0 },
										{ name: '宜春市', value: 0 },
										{ name: '南昌市', value: 0 },
										{ name: '景德镇市', value: 0 },
										{ name: '萍乡市', value: 0 },
										{ name: '鹰潭市', value: 0 },
										{ name: '新余市', value: 0 },
										{ name: '芗城区', value: 0 },
										{ name: '龙文区', value: 0 },
										{ name: '云霄县', value: 0 },
										{ name: '漳浦县', value: 0 },
										{ name: '诏安县', value: 0 },
										{ name: '长泰县', value: 0 },
										{ name: '东山县', value: 0 },
										{ name: '南靖县', value: 0 },
										{ name: '平和县', value: 0 },
										{ name: '华安县', value: 0 },
										{ name: '龙海市', value: 0 },
										{ name: '新罗区', value: 0 },
										{ name: '永定区', value: 0 },
										{ name: '长汀县', value: 0 },
										{ name: '上杭县', value: 0 },
										{ name: '武平县', value: 0 },
										{ name: '连城县', value: 0 },
										{ name: '漳平市', value: 0 },
										{ name: '仙游县', value: 0 },
										{ name: '秀屿区', value: 0 },
										{ name: '荔城区', value: 0 },
										{ name: '涵江区', value: 0 },
										{ name: '城厢区', value: 0 },
										{ name: '金门县', value: 0 },
										{ name: '德化县', value: 0 },
										{ name: '永春县', value: 0 },
										{ name: '安溪县', value: 0 },
										{ name: '惠安县', value: 0 },
										{ name: '泉港区', value: 0 },
										{ name: '洛江区', value: 0 },
										{ name: '丰泽区', value: 0 },
										{ name: '石狮市', value: 0 },
										{ name: '鲤城区', value: 0 },
										{ name: '鲤城区', value: 0 },
										{ name: '南安市', value: 0 },
										{ name: '蕉城区', value: 0 },
										{ name: '霞浦县', value: 0 },
										{ name: '古田县', value: 0 },
										{ name: '屏南县', value: 0 },
										{ name: '寿宁县', value: 0 },
										{ name: '周宁县', value: 0 },
										{ name: '柘荣县', value: 0 },
										{ name: '福安市', value: 0 },
										{ name: '福鼎市', value: 0 },
										{ name: '永定县', value: 0 },
										{ name: '晋江市', value: 0 }
									]
									,
									// viewControl:{
									// 	autoRotate:true
									// }
								}
							]
						});
						$.ajax({
							type: 'post',
							url: baseurl + "/county/listtotal",
							dataType: "json",
							contentType: "application/json",
							success: function (response) {
								console.log(response);
								var data_map = response;
								var mapdata = [];
								mapAllmoney = [];
								mapAllpeople = [];
								$.each(data_map, function (i, n) {
									// mapAllmoney.push(n.total_capital);
									mapAllpeople.push(n.total_person);
									mapdata.push({ name: '' + n.county + '', value: n.total_person, other: true });
								})
								// console.log(mapAllmoney);
								// maxN = Math.max.apply(null,mapAllmoney);
								maxP = Math.max.apply(null, mapAllpeople);
								// console.log(maxN,maxP);
								// console.log(maxP);
								// console.log(colorArrey[colorNow]);
								// console.log(minP);
								// console.log(mapdata);
								mapdata.push(
									{ name: '厦门市', value: 0 },
									{ name: '平潭县', value: 0 },
									{ name: '南平市', value: 0 },
									{ name: '三明市', value: 0 },
									{ name: '龙岩市', value: 0 },
									{ name: '宁德市', value: 0 },
									{ name: '漳州市', value: 0 },
									{ name: '莆田市', value: 0 },
									{ name: '泉州市', value: 0 },
									{ name: '赣州市', value: 0 },
									{ name: '吉安市', value: 0 },
									{ name: '上饶市', value: 0 },
									{ name: '九江市', value: 0 },
									{ name: '抚州市', value: 0 },
									{ name: '宜春市', value: 0 },
									{ name: '南昌市', value: 0 },
									{ name: '景德镇市', value: 0 },
									{ name: '萍乡市', value: 0 },
									{ name: '鹰潭市', value: 0 },
									{ name: '新余市', value: 0 },
									{ name: '丽水市', value: 0 },
									{ name: '杭州市', value: 0 },
									{ name: '温州市', value: 0 },
									{ name: '宁波市', value: 0 },
									{ name: '舟山市', value: 0 },
									{ name: '台州市', value: 0 },
									{ name: '金华市', value: 0 },
									{ name: '衢州市', value: 0 },
									{ name: '绍兴市', value: 0 },
									{ name: '嘉兴市', value: 0 },
									{ name: '湖州市', value: 0 },
									{ name: '高雄市', value: 0 },
									{ name: '屏东县', value: 0 },
									{ name: '台南市', value: 0 },
									{ name: '新竹市', value: 0 },
									{ name: '新竹县', value: 0 },
									{ name: '宜兰县', value: 0 },
									{ name: '基隆市', value: 0 },
									{ name: '苗栗县', value: 0 },
									{ name: '台北市', value: 0 },
									{ name: '新北市', value: 0 },
									{ name: '桃园县', value: 0 },
									{ name: '彰化县', value: 0 },
									{ name: '嘉义县', value: 0 },
									{ name: '嘉义市', value: 0 },
									{ name: '花莲县', value: 0 },
									{ name: '南投县', value: 0 },
									{ name: '台中市', value: 0 },
									{ name: '云林县', value: 0 },
									{ name: '台东县', value: 0 },
									{ name: '澎湖县', value: 0 },
									{ name: '金门', value: 0 },
									{ name: '马祖', value: 0 },
									{ name: '赣州市', value: 0 },
									{ name: '上饶市', value: 0 },
									{ name: '九江市', value: 0 },
									{ name: '抚州市', value: 0 },
									{ name: '宜春市', value: 0 },
									{ name: '南昌市', value: 0 },
									{ name: '景德镇市', value: 0 },
									{ name: '萍乡市', value: 0 },
									{ name: '鹰潭市', value: 0 },
									{ name: '新余市', value: 0 },
									{ name: '芗城区', value: 0 },
									{ name: '龙文区', value: 0 },
									{ name: '云霄县', value: 0 },
									{ name: '漳浦县', value: 0 },
									{ name: '诏安县', value: 0 },
									{ name: '长泰县', value: 0 },
									{ name: '东山县', value: 0 },
									{ name: '南靖县', value: 0 },
									{ name: '平和县', value: 0 },
									{ name: '华安县', value: 0 },
									{ name: '龙海市', value: 0 },
									{ name: '新罗区', value: 0 },
									{ name: '永定区', value: 0 },
									{ name: '长汀县', value: 0 },
									{ name: '上杭县', value: 0 },
									{ name: '武平县', value: 0 },
									{ name: '连城县', value: 0 },
									{ name: '漳平市', value: 0 },
									{ name: '仙游县', value: 0 },
									{ name: '秀屿区', value: 0 },
									{ name: '荔城区', value: 0 },
									{ name: '涵江区', value: 0 },
									{ name: '城厢区', value: 0 },
									{ name: '金门县', value: 0 },
									{ name: '德化县', value: 0 },
									{ name: '永春县', value: 0 },
									{ name: '安溪县', value: 0 },
									{ name: '惠安县', value: 0 },
									{ name: '泉港区', value: 0 },
									{ name: '洛江区', value: 0 },
									{ name: '丰泽区', value: 0 },
									{ name: '石狮市', value: 0 },
									{ name: '鲤城区', value: 0 },
									{ name: '鲤城区', value: 0 },
									{ name: '南安市', value: 0 },
									{ name: '蕉城区', value: 0 },
									{ name: '霞浦县', value: 0 },
									{ name: '古田县', value: 0 },
									{ name: '屏南县', value: 0 },
									{ name: '寿宁县', value: 0 },
									{ name: '周宁县', value: 0 },
									{ name: '柘荣县', value: 0 },
									{ name: '福安市', value: 0 },
									{ name: '福鼎市', value: 0 },
									{ name: '永定县', value: 0 },
									{ name: '晋江市', value: 0 }
								)
								// console.log(mapdata);
								chart.setOption({
									visualMap: [{
										type: 'continuous',
										show: false,
										min: 0,
										calculable: true,
										realtime: false,
										inRange: {
											color: colorArrey[colorNow],
											borderColor: '#366c71'
										},
									}, {
										type: 'continuous',
										max: maxP,
										seriesIndex: 1,
										realtime: true,
										textStyle: {
											color: '#fff',
											fontSize: '20',
										},
										calculable: false,
										inRange: {
											color: colorArrey[colorNow],
										},
										range: [1, maxP],
										outOfRange: {
											colorAlpha: 0
										},
									}],
									series: [
										{
											name: 'map3D',
											type: "map3D",
											map: 'fujian',
											itemStyle: {
												emphasis: { label: { show: false } }
											},
											data:
												mapdata
										}
									]
								})
							}
						});

					});
				})
			});
			//	})
		}
		//点击项目
		function dataMap(project) {
			$('.centermap').show();
			$.ajax({
				type: "POST",
				url: baseurl + "county/townMap",
				data: project,
				dataType: "json",
				contentType: 'application/json',
				success: function (result) {
					//             console.log(result);
					var geoCoordMap = {};
					var dataPoint = [];
					mapAllmoney = [];
					mapAllpeople = [];
					for (var i = 0; i < result.length; i++) {
						mapAllmoney.push(result[i].total_capital);
						geoCoordMap[result[i].township] = [result[i].precision, result[i].latitude]
						dataPoint.push({ 'name': result[i].township, 'value': result[i].total_capital })
					}
					maxN = Math.max.apply(null, mapAllmoney);
					//			console.log(maxN);
					//			 console.log(dataPoint);
					//			console.log(geoCoordMap);
					chart = echarts.init(document.getElementById('one'));
					var convertData = function (data) {
						var res = [];
						for (var ii = 0; ii < data.length; ii++) {
							var geoCoord = geoCoordMap[data[ii].name];
							//						 console.log(geoCoord);
							if (geoCoord) {
								res.push({
									name: data[ii].name,
									value: geoCoord.concat(data[ii].value)
								});
							}
						}
						//					  console.log(res)
						return res;
					};
					data_map = result;
					var mapdataAxis = [], newMapdata = [];
					mapdata = [];
					$.each(data_map, function (i, n) {
						mapdataAxis.push(n.county);
					})
					mapdataAxis = [...new Set(mapdataAxis)]; //将区域归纳整理好
					mapdataAxis.forEach(function (el, index) {
						var total_personMap = 0;
						data_map.forEach(function (el1, index) {
							if (el == el1.county) {
								total_personMap += Number(el1.total_person);
							}
						})
						mapAllpeople.push(total_personMap);
						mapdata.push({ name: el, value: total_personMap, other: true });
					})
					maxP = Math.max.apply(null, mapAllpeople);
					// console.log(maxN, maxP);
					// console.log(colorArrey[colorNow]);
					// $.each(data_map,function(i,n){
					// 	mapdata.push({name:''+n.county+'',value:n.total_person,other:true});
					// })
					//					 console.log(mapdata);
					mapdata.push(
						{ name: '厦门市', value: 0 },
						{ name: '平潭县', value: 0 },
						{ name: '南平市', value: 0 },
						{ name: '三明市', value: 0 },
						{ name: '龙岩市', value: 0 },
						{ name: '宁德市', value: 0 },
						{ name: '漳州市', value: 0 },
						{ name: '莆田市', value: 0 },
						{ name: '泉州市', value: 0 },
						{ name: '赣州市', value: 0 },
						{ name: '吉安市', value: 0 },
						{ name: '上饶市', value: 0 },
						{ name: '九江市', value: 0 },
						{ name: '抚州市', value: 0 },
						{ name: '宜春市', value: 0 },
						{ name: '南昌市', value: 0 },
						{ name: '景德镇市', value: 0 },
						{ name: '萍乡市', value: 0 },
						{ name: '鹰潭市', value: 0 },
						{ name: '新余市', value: 0 },
						{ name: '丽水市', value: 0 },
						{ name: '杭州市', value: 0 },
						{ name: '温州市', value: 0 },
						{ name: '宁波市', value: 0 },
						{ name: '舟山市', value: 0 },
						{ name: '台州市', value: 0 },
						{ name: '金华市', value: 0 },
						{ name: '衢州市', value: 0 },
						{ name: '绍兴市', value: 0 },
						{ name: '嘉兴市', value: 0 },
						{ name: '湖州市', value: 0 },
						{ name: '高雄市', value: 0 },
						{ name: '屏东县', value: 0 },
						{ name: '台南市', value: 0 },
						{ name: '新竹市', value: 0 },
						{ name: '新竹县', value: 0 },
						{ name: '宜兰县', value: 0 },
						{ name: '基隆市', value: 0 },
						{ name: '苗栗县', value: 0 },
						{ name: '台北市', value: 0 },
						{ name: '新北市', value: 0 },
						{ name: '桃园县', value: 0 },
						{ name: '彰化县', value: 0 },
						{ name: '嘉义县', value: 0 },
						{ name: '嘉义市', value: 0 },
						{ name: '花莲县', value: 0 },
						{ name: '南投县', value: 0 },
						{ name: '台中市', value: 0 },
						{ name: '云林县', value: 0 },
						{ name: '台东县', value: 0 },
						{ name: '澎湖县', value: 0 },
						{ name: '金门', value: 0 },
						{ name: '马祖', value: 0 },
						{ name: '赣州市', value: 0 },
						{ name: '上饶市', value: 0 },
						{ name: '九江市', value: 0 },
						{ name: '抚州市', value: 0 },
						{ name: '宜春市', value: 0 },
						{ name: '南昌市', value: 0 },
						{ name: '景德镇市', value: 0 },
						{ name: '萍乡市', value: 0 },
						{ name: '鹰潭市', value: 0 },
						{ name: '新余市', value: 0 },
						{ name: '芗城区', value: 0 },
						{ name: '龙文区', value: 0 },
						{ name: '云霄县', value: 0 },
						{ name: '漳浦县', value: 0 },
						{ name: '诏安县', value: 0 },
						{ name: '长泰县', value: 0 },
						{ name: '东山县', value: 0 },
						{ name: '南靖县', value: 0 },
						{ name: '平和县', value: 0 },
						{ name: '华安县', value: 0 },
						{ name: '龙海市', value: 0 },
						{ name: '新罗区', value: 0 },
						{ name: '永定区', value: 0 },
						{ name: '长汀县', value: 0 },
						{ name: '上杭县', value: 0 },
						{ name: '武平县', value: 0 },
						{ name: '连城县', value: 0 },
						{ name: '漳平市', value: 0 },
						{ name: '仙游县', value: 0 },
						{ name: '秀屿区', value: 0 },
						{ name: '荔城区', value: 0 },
						{ name: '涵江区', value: 0 },
						{ name: '城厢区', value: 0 },
						{ name: '金门县', value: 0 },
						{ name: '德化县', value: 0 },
						{ name: '永春县', value: 0 },
						{ name: '安溪县', value: 0 },
						{ name: '惠安县', value: 0 },
						{ name: '泉港区', value: 0 },
						{ name: '洛江区', value: 0 },
						{ name: '丰泽区', value: 0 },
						{ name: '石狮市', value: 0 },
						{ name: '鲤城区', value: 0 },
						{ name: '鲤城区', value: 0 },
						{ name: '南安市', value: 0 },
						{ name: '蕉城区', value: 0 },
						{ name: '霞浦县', value: 0 },
						{ name: '古田县', value: 0 },
						{ name: '屏南县', value: 0 },
						{ name: '寿宁县', value: 0 },
						{ name: '周宁县', value: 0 },
						{ name: '柘荣县', value: 0 },
						{ name: '福安市', value: 0 },
						{ name: '福鼎市', value: 0 },
						{ name: '永定县', value: 0 },
						{ name: '晋江市', value: 0 }
					)
					chart.setOption({
						visualMap: [{
							type: 'continuous',
							max: maxN,
							min: 0,
							calculable: true,
							realtime: false,
							inRange: {
								// color:['#Fff'],
								color: colorArrey[colorNow],
								// color:['#FFD700','#DAA520','#F4A460','#CD2626','#FF7F50','#FF4500'],
								// color: [ '#32899d','#938b2a', '#915e35', '#81303c','#37e5c9','#4e895e'],
								// borderColor:'#366c71'
							},
							outOfRange: {
								colorAlpha: 0
							}
						}, {
							type: 'continuous',
							max: maxP,
							seriesIndex: 1,
							realtime: true,
							textStyle: {
								color: '#fff',
								fontSize: '20',
							},
							calculable: false,
							inRange: {
								// color:['#fff'],
								color: colorArrey[colorNow],
								// color: [ '#32899d','#938b2a', '#915e35', '#81303c','#37e5c9','#4e895e'],
							},
							range: [1, maxP],
							outOfRange: {
								colorAlpha: 0
							}
						}],
						series: [
							{
								data: convertData(dataPoint),
								name: 'bar3D',
								type: "bar3D",
								coordinateSystem: 'geo3D',
								barSize: 0.15, //柱子粗细
								shading: 'realistic',
								opacity: 1,
								bevelSize: 0.5,
								label: {
									show: false,
									formatter: '{b}'
								}
							},
							{
								name: 'map3D',
								type: "map3D",
								map: 'fujian',
								itemStyle: {
									emphasis: { label: { show: false } }
								},
								data:
									mapdata
							}]
					})
					$('.centermap').hide();
					// 		setTimeout(function(){
					// 	// chart.clear();
					// 	chart.setOption({
					// 			visualMap:[{
					// 					inRange: {
					// 						color:colorArrey[colorNow],
					// 					},
					// 				},{
					// 					inRange: {
					// 						color:colorArrey[colorNow],
					// 					},
					// 				}],
					// 				series:[
					// 				{
					// 					data: convertData(dataPoint),
					// 				},
					//             {
					// 							name: 'map3D',
					// 							type: "map3D",
					// 							map: 'fujian',	
					// 		                itemStyle:{
					// 		                    emphasis:{label:{show:false}}
					// 		                },			
					// 							data:
					// 							mapdata
					// 						}]
					// 		})
					// },1500)
				}
			});
		}
	</script>
</body>

</html>